Add tooltips for the icons of the network modification table#3806
Add tooltips for the icons of the network modification table#3806Mathieu-Deharbe merged 8 commits intomainfrom
Conversation
Signed-off-by: SOUISSI Maissa (Externe) <souissimai@gm0winl878.bureau.si.interne>
.../graph/menus/network-modifications/network-modification-table/renderers/description-cell.tsx
Outdated
Show resolved
Hide resolved
...onents/graph/menus/network-modifications/network-modification-table/row/modification-row.tsx
Outdated
Show resolved
Hide resolved
...onents/graph/menus/network-modifications/network-modification-table/row/modification-row.tsx
Outdated
Show resolved
Hide resolved
...onents/graph/menus/network-modifications/network-modification-table/row/modification-row.tsx
Outdated
Show resolved
Hide resolved
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated tooltip/i18n keys and tooltip wrappers across network-modification UI; refactored per-row cell rendering to apply drag-handle props to a nested span and added selection/drag tooltips; added corresponding English and French translation keys and small formatting edits. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Row as ModificationRow
participant DD as DragDropProvider
participant Tooltip as MUI_Tooltip
participant Store as Selection/State
User->>Row: hover / click / drag handle
Row->>Tooltip: request tooltip text (FormattedMessage)
Row->>DD: attach provided.dragHandleProps to nested <span>
Tooltip-->>User: display contextual message (move/select/visualizedRootNetwork)
User->>Row: click selection/toggle
Row->>Store: update selection/activation state
Store-->>Row: updated state
Row->>Tooltip: update tooltip message (select/deselect/activate/deactivate)
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@src/components/graph/menus/network-modifications/network-modification-table/renderers/description-cell.tsx`:
- Line 63: The Tooltip currently uses the nullish coalescing operator with
description (Tooltip title={description ?? <FormattedMessage
id={'addDescription'} />}), which fails when description is an empty string;
change the check to a non-empty string test instead (e.g., use
description?.trim() or description && description.length) so that when
description is empty the fallback FormattedMessage ('addDescription') is shown;
update the Tooltip title expression and ensure it still references the same
description variable and the existing FormattedMessage id.
In
`@src/components/graph/menus/network-modifications/network-modification-table/row/modification-row.tsx`:
- Around line 50-55: Remove the temporary debug log inside the cell render loop:
eliminate the console.log(cellContent, 'pppp') that runs in the mapping over
row.getVisibleCells() (used with flexRender(cell.column.columnDef.cell,
cell.getContext())). Locate the map callback where row.getVisibleCells().map is
used and delete that console.log; if needed keep a conditional debug only behind
a dev-only flag or debugger statement rather than logging on every cell render
(especially for columns referenced via
BASE_MODIFICATION_TABLE_COLUMNS.DRAG_HANDLE and .SELECT).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5ffb7ceb-8106-482f-91d5-60ea31708a74
📒 Files selected for processing (7)
src/components/graph/menus/network-modifications/network-modification-node-editor.tsxsrc/components/graph/menus/network-modifications/network-modification-table/columns-definition.tsxsrc/components/graph/menus/network-modifications/network-modification-table/renderers/description-cell.tsxsrc/components/graph/menus/network-modifications/network-modification-table/renderers/switch-cell.tsxsrc/components/graph/menus/network-modifications/network-modification-table/row/modification-row.tsxsrc/translations/en.jsonsrc/translations/fr.json
.../graph/menus/network-modifications/network-modification-table/renderers/description-cell.tsx
Outdated
Show resolved
Hide resolved
...onents/graph/menus/network-modifications/network-modification-table/row/modification-row.tsx
Show resolved
Hide resolved
.../graph/menus/network-modifications/network-modification-table/renderers/description-cell.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Mathieu Deharbe <148252167+Mathieu-Deharbe@users.noreply.github.com>
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
Signed-off-by: Mathieu DEHARBE <mathieu.deharbe@rte-france.com>
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/translations/fr.json (2)
1718-1727: Inconsistent JSON formatting.The new entries have formatting inconsistencies compared to the rest of the file:
- Lines 1718, 1721-1723: Space before colon (
:should be:)- Line 1724: Space before comma (
" ,)- Line 1726: Trailing space after the value
- Line 1727: Leading space before closing brace
🧹 Proposed fix
- "downloadNetworkModifications" : "Télécharger les modifications", - "moveToTrash": "Mettre à la corbeille", - "visualizedRootNetwork": "Réseau racine visualisé : {tag}", - "addDescription" : "Ajouter une description", - "activateModification" : "Activer la modification réseau", - "deactivateModification" : "Désactiver la modification réseau", - "deselectModification": "Désélectionner la modification" , - "selectModification": "Sélectionner la modification", - "moveModification": "Déplacer la modification" - } + "downloadNetworkModifications": "Télécharger les modifications", + "moveToTrash": "Mettre à la corbeille", + "visualizedRootNetwork": "Réseau racine visualisé : {tag}", + "addDescription": "Ajouter une description", + "activateModification": "Activer la modification réseau", + "deactivateModification": "Désactiver la modification réseau", + "deselectModification": "Désélectionner la modification", + "selectModification": "Sélectionner la modification", + "moveModification": "Déplacer la modification" +}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/translations/fr.json` around lines 1718 - 1727, The JSON entries for keys "downloadNetworkModifications", "addDescription", "activateModification", "deactivateModification", "deselectModification", "selectModification", and "moveModification" have inconsistent spacing and stray whitespace; fix them to match the file's standard JSON formatting by removing spaces before colons (use ":" not " :"), removing the extra space before the comma in "deselectModification", trimming the trailing space after the "moveModification" value, and removing the leading space before the closing brace so each key/value pair follows the same "key": "value", pattern as the rest of the file.
11-11: Trailing whitespace after comma.There's a trailing space after the comma on this line. Consider removing it for consistency.
🧹 Proposed fix
- "filter": "Filtre", + "filter": "Filtre",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/translations/fr.json` at line 11, Remove the trailing whitespace after the comma in the JSON entry for the "filter" key so the line reads with no extra space following the comma; locate the "filter": "Filtre", entry and delete the trailing space to keep JSON formatting consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/translations/fr.json`:
- Around line 1718-1727: The JSON entries for keys
"downloadNetworkModifications", "addDescription", "activateModification",
"deactivateModification", "deselectModification", "selectModification", and
"moveModification" have inconsistent spacing and stray whitespace; fix them to
match the file's standard JSON formatting by removing spaces before colons (use
":" not " :"), removing the extra space before the comma in
"deselectModification", trimming the trailing space after the "moveModification"
value, and removing the leading space before the closing brace so each key/value
pair follows the same "key": "value", pattern as the rest of the file.
- Line 11: Remove the trailing whitespace after the comma in the JSON entry for
the "filter" key so the line reads with no extra space following the comma;
locate the "filter": "Filtre", entry and delete the trailing space to keep JSON
formatting consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6d826ea7-81ae-4739-a346-2de55c8d2619
📒 Files selected for processing (4)
src/components/graph/menus/network-modifications/network-modification-node-editor.tsxsrc/components/graph/menus/network-modifications/network-modification-table/row/modification-row.tsxsrc/translations/en.jsonsrc/translations/fr.json
✅ Files skipped from review due to trivial changes (2)
- src/components/graph/menus/network-modifications/network-modification-node-editor.tsx
- src/components/graph/menus/network-modifications/network-modification-table/row/modification-row.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/translations/en.json
Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
|



icons: trash, root network, drag and drop, description, activation, selection